<<<<<<< HEAD
#本代码是计算resnet18的参数量

# -- coding: utf-8 --
import torch
import torchvision
from thop import profile

if __name__ == "__main__":
    # Model
    print('==> Building model..')
    model = torchvision.models.resnet18(pretrained=False)

    dummy_input = torch.randn(1, 3, 224, 224)
    flops, params = profile(model, (dummy_input,))
    print(model)
    print('flops: ', flops, 'params: ', params)
    print('flops: %.2f M, params: %.2f M' % (flops / 1000000.0, params / 1000000.0))
=======
#本代码是计算resnet18的参数量

# -- coding: utf-8 --
import torch
import torchvision
from thop import profile

if __name__ == "__main__":
    # Model
    print('==> Building model..')
    model = torchvision.models.resnet152(pretrained=False)
    model.cuda(0)

    dummy_input = torch.randn(1, 3, 224, 224)
    dummy_input = dummy_input.cuda(0)
    flops, params = profile(model, (dummy_input,))
    print(model)
    print('flops: ', flops, 'params: ', params)
    print('flops: %.2f G, params: %.2f M' % (flops / 1000000000.0, params / 1000000.0))
>>>>>>> 6d113152988ae2953b7b474b802b9c92e9cb7e91
